<?php
//$this->Html->script(array('plugins/datatables/jquery.dataTables.min'), false);
?>
<?php
echo $this->Form->create('Paginate', array(
	'class' => 'validate',
	'action' => 'index',
	'url' => $this->request->here(false),
	'type' => 'post',
	'inputDefaults' => array('label' => false, 'div' => false)));
echo $this->Form->input('Paginate.task', array('style' => 'display:none;', 'value' => '', 'id' => 'task'));
?>
<div class="page-header clearfix">
	<h1>
		<?php echo __('Business management'); ?> 
	</h1>
	<a href="<?php echo $this->Html->url('/admin/users');?>"><?php echo __('Manage users');?></a>
	<div class="page-toolbar pull-right">
		<div class="btn-group ctr-container">
			<a class="btn btn-primary ctr-add" href="<?php echo Router::url(array('action' => 'add')) ?>">
				<span class="ico-add"></span>
				<?php echo __('Add business'); ?>
			</a>
		</div>
	</div>
</div>

<div class="row-fluid">
	<div class="span12">
		<div class="block">
			<?php
			$continue = array(
				'?' => array('continue' => $this->request->here(false))
			);
			echo $this->Session->flash();
			?>
			<div class="data-fluid">
				<table class="table paginate lcnp" cellpadding="0" cellspacing="0" width="100%">
					<thead>
						<tr>
							<th width="20%"><?php echo __('Business name'); ?></th>
							<th width="20%"><?php echo __('Nombre de cartes disponible'); ?></th>
							<th width="80"><?php echo __('Value'); ?></th>
							<th width="80"><?php echo __('Description'); ?></th>
							<th width="60" class="TAC">Action</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($businesses as $business) : ?>
							<tr>
								<td>
									<?php echo $business['Business']['name']; ?>
								</td>
								<td>
									<?php echo $business['Business']['offer_number']; ?>
								</td>
								<td>
									<?php echo $business['Business']['value']; ?>
								</td>
								<td>
									<?php echo $business['Business']['description'] ?>
								</td>
								<td class="table-action">
								<?php echo $this->Html->link(__('Edit'),array('action' => 'edit', $business['Business']['id']),array(
										'class' => 'btn btn-primary'
											)); ?>
									<?php
									echo $this->Html->link(__('Delete'), $continue + array('action' => 'delete', $business['Business']['id']), array(
										'class' => 'btn btn-primary'
											), 'You want to delete?');
									?>                                             
								</td>
							</tr>
						<?php endforeach; ?>                         
					</tbody>
				</table>                    
			</div> 
		</div>
	</div>
</div>
<?php echo $this->Form->end(); ?>
<style type="text/css">
	.paginate tr.disabled td,.paginate tr.disabled td a{
		color: #f00 !important;
	}
</style>